package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售实体类
 */
@TableName("t_sale")
public class SaleBean {
    //销售编号
    @TableId(value = "pk_saleId",type = IdType.AUTO)
    private Integer id;
    //销售员
    @TableField("s_user")
    private String user;
    //销售日期
    @TableField("s_date")
    private LocalDate date = LocalDate.now();
    //销售地址
    @TableField("s_address")
    private String address;
    //销售明细集合
    @TableField(exist = false)
    private List<SaleInfoBean> saleInfoList;
    //销售总金额
    @TableField("s_totalPrice")
    private Integer totalPrice;
    // 客户id
    @TableField("fk_clientId")
    private Integer clientId;
    // 客户实体类
    @TableField(exist = false)
    private CustomerBean customerBean;

    public SaleBean() {
    }

    public SaleBean(String user, String address, Integer totalPrice, Integer clientId) {
        this.user = user;
        this.address = address;
        this.totalPrice = totalPrice;
        this.clientId = clientId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public List<SaleInfoBean> getSaleInfoList() {
        return saleInfoList;
    }

    public void setSaleInfoList(List<SaleInfoBean> saleInfoList) {
        this.saleInfoList = saleInfoList;
    }

    public Integer getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = clientId;
    }

    public CustomerBean getCustomerBean() {
        return customerBean;
    }

    public void setCustomerBean(CustomerBean customerBean) {
        this.customerBean = customerBean;
    }

    @Override
    public String toString() {
        return "SaleBean{" +
                "id=" + id +
                ", user='" + user + '\'' +
                ", date=" + date +
                ", address='" + address + '\'' +
                ", saleInfoList=" + saleInfoList +
                ", totalPrice=" + totalPrice +
                ", clientId=" + clientId +
                ", customerBean=" + customerBean +
                "}\n";
    }
}
